package edu.pitt.dbmi.odie.gapp.gwt.client.dao;

import com.google.gwt.user.client.rpc.IsSerializable;
/*
 * Note this must be IsSerializable or it will fail when deployed to gapps
 */

public class ODIE_DaoDocument implements IsSerializable {

	private String odieId;
	private String odieAnalysisId;
	private String title;
	private String atomId;
	private String rawId;
	private String documentStatus;
	private Integer currentLineOffset;
	private Integer currentAnnotationOffset;
	private Integer numberOfLines;
	private boolean isSelected;
	
	private ODIE_DaoAnnotation[] annotations;

	public String getId() {
		return this.odieId;
	}
	
	public String getOdieId() {
		return this.odieId;
	}

	public void setOdieId(String odieId) {
		this.odieId = odieId;
	}

	public String getOdieAnalysisId() {
		return odieAnalysisId;
	}

	public void setOdieAnalysisId(String odieAnalysisId) {
		this.odieAnalysisId = odieAnalysisId;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getAtomId() {
		return atomId;
	}

	public void setAtomId(String atomId) {
		this.atomId = atomId;
	}

	public String getRawId() {
		return rawId;
	}

	public void setRawId(String rawId) {
		this.rawId = rawId;
	}

	public String getDocumentStatus() {
		return documentStatus;
	}

	public void setDocumentStatus(String documentStatus) {
		this.documentStatus = documentStatus;
	}

	public Integer getCurrentLineOffset() {
		return currentLineOffset;
	}

	public void setCurrentLineOffset(Integer currentLineOffset) {
		this.currentLineOffset = currentLineOffset;
	}

	public Integer getCurrentAnnotationOffset() {
		return currentAnnotationOffset;
	}

	public void setCurrentAnnotationOffset(Integer currentAnnotationOffset) {
		this.currentAnnotationOffset = currentAnnotationOffset;
	}

	public Integer getNumberOfLines() {
		return numberOfLines;
	}

	public void setNumberOfLines(Integer numberOfLines) {
		this.numberOfLines = numberOfLines;
	}
	
	public boolean isSelected() {
		return isSelected;
	}

	public void setSelected(boolean isSelected) {
		this.isSelected = isSelected;
	}
	
	public ODIE_DaoAnnotation[] getAnnotations() {
		return annotations;
	}

	public void setAnnotations(ODIE_DaoAnnotation[] annotations) {
		this.annotations = annotations;
	}
	

	public ODIE_DaoAnnotation getSelectedAnnotation() {
		ODIE_DaoAnnotation result = null ;
		if (this.annotations != null && this.annotations.length > 0) {
			for (ODIE_DaoAnnotation annotation : this.annotations) {
				if (annotation.isSelected()) {
					result = annotation ;
					break ;
				}
			}
		}
		return result ;
	}


}
